document.querySelector('form button').addEventListener('click', function (e) {
    e.preventDefault()
    let phone = document.querySelector('[name="phone"]').value
    let pass = document.querySelector('[name="pass"]').value
    // console.log(phone, pass);
    if (phone === '' || pass === '') {
        return alert('请输入完整')
    }
    axios({
        method: 'post',
        url: '/user/login',
        data: {
            phone,
            pass
        },
    }).then(res => {
        // 请求成功
        console.log(res);
        if (res.data.status === 200) {
            alert(res.data.msg)
            window.location.href = '../index.html'
        } else {
            alert(res.data.msg)
        }

    })


})